package com.book.controller;


import com.book.result.Result;
import com.book.service.FansService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author cxy
 * @since 2023-10-12 16:01:37
 */
@RestController
@RequestMapping("/fans")
public class FansController {
    @Autowired
    private FansService fansService;

    //查询一个作者的粉丝数量
    @GetMapping("aunthorFans")
    public Result aunthorFans(@RequestParam Long authorId){
        Integer fandsNum=fansService.aunthorFans(authorId);
        return Result.OK().setData(fandsNum);
    }
}
